# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-python-whois
pkgname=('python2-python-whois' 'python-python-whois')
_pkgname=python-whois
pkgver=0.9.5
pkgrel=1
pkgdesc='Whois querying and parsing of domain registration information.'
arch=('any')
url='https://pypi.org/project/python-whois/#files'
license=('WTFPL')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('aff3f2990f2f06559ae85037e6c44ab0ad22fbdb34cee78ce836804f94ecd10dc562bdba9cf531ee47db4b6909d510550ea928de04d9d6166af88f7dc6f27f1f')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-python-whois() {
  depends=('python2' 'python2-future')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-python-whois() {
  depends=('python' 'python-future')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

